<?php
/**
 * Created by PhpStorm.
 * User: pc
 * Date: 2025/2/20
 * Time: 17:53
 */

namespace app\common\service\options;

use app\common\enum\EtcOfficeProductSelected_isSelectEnum;
use app\common\enum\EtcOfficeProductSelected_SendStatusEnum;
use app\common\enum\EtcOfficeProductSelected_VideoStatusEnum;
use app\common\service\OptionMap;
use app\common\service\OptionMapItem;
use app\modules\setting\models\null\EtcOfficeTiktokAccount;
use app\modules\setting\models\office\EtcOfficeAddress;
use app\modules\setting\models\seller\EtcSellerTiktokProduct;
use app\modules\setting\models\xtxx\SetXtxxTkcat;
use app\modules\setting\models\xtxx\SetXtxxTkqz;
use sookie\auth\models\Adminuser;
use yii\helpers\ArrayHelper;

class officeSelling extends OptionMap
{
    public $map = [];

    public function getMap()
    {
        $info = Adminuser::getUserInfo();
        $id = ArrayHelper::getValue($info,'id');

        $this->map = [
//            'product_id' =>  OptionMapItem::createInstance()->setClass(EtcSellerTiktokProduct::class)->setName("name"),
            'is_select' =>  OptionMapItem::createInstance()->setOptions(EtcOfficeProductSelected_isSelectEnum::toOptions(false)),
            'send_sample_address_id' =>  OptionMapItem::createInstance()->setClass(EtcOfficeAddress::class)->setName("concat(name,'  ',phone,'  ',address)"),
            'send_status' =>  OptionMapItem::createInstance()->setOptions(EtcOfficeProductSelected_SendStatusEnum::toOptions(false)),
            'video_status' =>  OptionMapItem::createInstance()->setOptions(EtcOfficeProductSelected_VideoStatusEnum::toOptions(false)),

            'tiktok_id' =>  OptionMapItem::createInstance()->setClass(EtcOfficeTiktokAccount::class)->setWhere(['user_id' => $id])->setName("name"),
        ];
        return $this->map;
    }
}